﻿-var entity = ViewData["entity"] as ScheduleDayException
.padded5
  %form.validate{action="scheduledayexception.ivp/save",method="post"}
    _formfields
    =HTMLHelper.HiddenInput("id",entity.Id)
    =HTMLHelper.HiddenInput("scheduleid",entity.ScheduleId)
    .formheader
      %h1
        %img.icon24{src="img/headericons/user.gif"}
        Исключение в расписании
    _error
    .formbody
      %table
        %tr
          %td{width="140"}
            %label{for="date"} Дата
            %input.dateRU#date{name="date",value=entity.Date.ToDateString()}
          %td
            .hspacer20
          %td{width="340"}
            %label &nbsp;
            =HTMLHelper.Radio("typeid", 1, entity.TimeStart.HasValue, "Рабочий день", "cb", "onclick=\"$('#workingtime').show();\"")
            =HTMLHelper.Radio("typeid", 2, !entity.TimeStart.HasValue, "Нерабочий день", "cb", "onclick=\"$('#workingtime').hide();$('#workingtime input').val('');\"")
        %tr
          %td{colspan="3"}
            %label{for="description"} Описание
            %textarea#description.px500.basictext{name="description",rows="4",maxlength="1000"}=entity.Description
        %tr#workingtime{class=entity.TimeStart.HasValue?"":"hidden"}
          %td
            %label Рабочее время
            =HTMLHelper.TextInput("timestart",entity.TimeStart.ToTimeString(),"timestart time",5)
            ="&mdash;"
            =HTMLHelper.TextInput("timeend",entity.TimeEnd.ToTimeString(),"timeend time",5)
          %td
            .hspacer20
          %td
            %label Перерыв
            =HTMLHelper.TextInput("breakstart",entity.BreakStart.ToTimeString(),"breakstart time",5)
            ="&mdash;"
            =HTMLHelper.TextInput("breakend",entity.BreakEnd.ToTimeString(),"breakend time",5)
    .formbottom
      %button.saveandreturn#submit{type="submit",onclick="$('#closeaftersave').val('true')"} Сохранить и закрыть
      %button.save#submit{type="submit",onclick="$('#returnaftersave').val('')"} Сохранить
      %button.return{type="button",onclick="self.close();"} Закрыть